Array.prototype.myMap = function(fn, thisValue) {
    var res = [];
    thisValue = thisValue || [];
    this.reduce(function(pre, cur, index, arr) {
        return res.push(fn.call(thisValue, cur, index, arr));
    }, []);
    return res;
}

let a = [1, 2, 3];
console.log(a.myMap((a) => a * 10))